#include"IpAddressPort.h"
#include<sstream>
#include<iostream>

    IpAddressPort::IpAddressPort(std::string &&ip,unsigned short &&port):m_ip(std::move(ip)),m_port(std::move(port)){}
    std::string IpAddressPort::ToString()const
    {
        std::stringstream ss;
        ss<<m_ip<<":"<<m_port;
        return ss.str();
    }
    void IpAddressPort::SetIpAddress(std::string& ip)
    {
        m_ip=ip;
    }
    std::string IpAddressPort::GetIpAddress()const 
    {
        return m_ip;
    }
    void IpAddressPort::SetPort(unsigned short& port)
    {
        m_port=port;
    }
    unsigned short IpAddressPort::GetPort()const
    {
        return m_port;
    }
/*
    int main()
    {
        IpAddressPort t("127.0.0.1",6000);
        std::cout<<t.ToString()<<std::endl;
        return 0;
    }
    */